import javax.swing.*;

import java.awt.*;
import java.awt.event.ActionEvent;

public class EskaeraOna extends Frame{
	Frame nireFrame;
	String izena;
	String pasahitza;
	public EskaeraOna(Frame parent, Boolean modal, String i, String p) {
		nireFrame = parent;
		izena = i;
		pasahitza = p;
		enableEvents(AWTEvent.WINDOW_EVENT_MASK);
		try {
			jbInit();
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}

	private void jbInit() throws Exception {
		final JFrame f = new JFrame();
		Container container = f.getContentPane();
		container.setLayout(null);
		JLabel ondo = new JLabel("Eskaera ondo joan da");
		ondo.setBounds(80, 50, 150, 25);
		f.add(ondo);
		JButton onartu = new JButton("Onartu");
		onartu.setBounds(90, 90, 100, 25);
		f.add(onartu);
		f.setSize(300,200);
		f.setTitle("Euskaltoy");
		f.setVisible(true);
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		onartu.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(ActionEvent e) {
				onartu_actionPerformed(e, izena, pasahitza);
				f.setVisible(false);
			}
		});
	}
	void onartu_actionPerformed(ActionEvent e, String izena, String pasahitza) {
		new Eskaera(this, true, izena, pasahitza);
	}
}